<?php
include_once 'user.class.php';
/**
 *显示登录前的页面
 * @author yaoli<yaoli@pateo.com.cn>
 * @version 1.0 add by yaoli<yaoli@pateo.com.cn> 
 */
class login extends ActionBase1 {
	
	
	function init(){
		
	}
	
	/**
	 * 动作
	 *
	 * @see AActionBase::action()
	 */
	public function action() {
		
		 show404("不存在的方法！");
	}
	
	public function showlogin() {
		$this->template('showlogin.html');
		#echo "Login";exit;
	}
	
	public function resetpwd(){
		$this->template("resetpwd.html");
	}
	
	public function resetpwd2(){// ASH校验
		if($_SESSION["sessionRound"]!=$this->data['request']['validate']){
			showEror("验证码错误!请重新输入",'');
		}
		
		if(!is_numeric($this->data['request']['phone'])){
			showEror("手机号码为必填项!");
		}
		
		$this->sendsms();
		
		$this->data['phone'] = $this->data['request']['phone'];
		
		#filter::checkformhash ( $this->data ['request'] ['HASH_CODE'] );
		$this->template("resetpwd2.html");
	}
	
	public function resetpwd3(){// ASH校验
		if($this->data['request']['smsvalidate'] == $_SESSION['charcode']){
			$this->template("resetpwd3.html");
		}else{
			showEror("错误的验证码!",url("login/resetpwd"));
		}
	}
	
	//发短信的请求
	public function sendsms(){
		$_SESSION['charcode'] = rand(1000,9999);
		echo $_SESSION['charcode'];
	}
	
	public function checkVhl(){
		$welcome = user::getuserinfo();
		
		
		$this->data['vhllist'] = $welcome['vhlList'];
		#dump($this->data['vhllist']);
		$this->template("checkVhl.html");
	}
	
	public function validatePic(){
		echo load_libra("validate")->validatepic();
	}
	
}
